#ifndef _INI_H_
#define _INI_H_

#ifdef __cplusplus
extern "C"{
#endif

typedef struct INT_ENT {
	unsigned int hash;
	char * key;
	char * value;
} INT_ENT;

typedef struct INI {
	unsigned int cap;
	unsigned int size;
	INT_ENT * array;
} INI;

INI * ini_new();
int ini_load(INI * p, const char * path);
int ini_dump(INI * p);
int ini_free(INI * p);
const char * ini_get_str(INI * p, const char * key, const char * def);
int ini_get_int(INI * p, const char * key, int def);
double ini_get_double(INI * p, const char * key, double def);
int ini_get_bool(INI * p, const char * key, int def);
int ini_isset_section(INI * p, const char * section);

char * lwcstrip(char *s);
#ifdef __cplusplus
}
#endif

#endif
